home *** CD-ROM | disk | FTP | other *** search
- Program ConVerTLog {2.0 to 3.1};
- Type
- CommandString = string[50];
- Datestring = string[8];
- CommentString = string[12];
- Filename = string[24];
-
- LogRec20 = Record
- r : integer; {record counter}
- date : Datestring; {date}
- time : Datestring; {time}
- elapsed : Datestring; {elapsed}
- comment : CommandString; {comment}
- end;
-
- LogRec31 = Record
- usage : char; {usage type, i.e. business/personal}
- date : Datestring; {start date}
- time : Datestring; {start time}
- elapsed : Datestring; {elapsed time}
- comment : CommentString; {comment}
- end;
-
- Var
- logfile20 : file of LogRec20;
- logfile31 : file of LogRec31;
- log_data20 : logrec20;
- log_data31 : logrec31;
- i : integer;
- ch : char;
-
- Const
- logfile31name : filename = 'TIME31.LOG';
- logfile20name : filename = 'TIME20.LOG';
-
-
-
- Begin {program}
-
- lowvideo;
- writeln;
- writeln('This program will convert a LOG V 2.0 TIME.LOG file to a');
- writeln('LOG V 3.1 TIME.LOG file. First you must rename the 2.0');
- writeln('TIME.LOG file to TIME20.LOG. This program will then create');
- writeln('the file TIME31.LOG, which you must rename TIME.LOG in order');
- writeln('to use with the LOG program. This may seem like a lot of');
- writeln('screwing around, but it''ll help prevent accidental file');
- writeln('overwrites. Besides... what do you expect for free?');
- writeln;
- writeln('If TIME20.LOG is in the current directory,');
- writeln('then press any key to continue, ^C to abort...');
- read(kbd,ch);
-
- Assign(logfile31,logfile31name);
- Rewrite(logfile31);
- Assign(logfile20,logfile20name);
- reset(logfile20);
-
- for i:=0 to filesize(logfile20)-1 do
- begin
- seek(logfile20,i);
- read(logfile20,log_data20);
-
- log_data31.date:= log_data20.date;
- log_data31.time:= log_data20.time;
- log_data31.elapsed:= log_data20.elapsed;
-
- writeln('Date : ',log_data31.date);
- writeln('Time : ',log_data31.time);
- writeln('Elapsed: ',log_data31.elapsed);
- writeln;
- writeln('Originally entered as: ',log_data20.comment);
- writeln('Shorten to "',copy(log_data20.comment,1,12),'"');
- write('(Y/N?) ');
- read(kbd,ch); writeln(upcase(ch));
- if upcase(ch)='Y' then log_data31.comment:=
- copy(log_data20.comment,1,12)
- else
- begin
- writeln;
- writeln(' |<-------->|');
- write('Enter new description: ');
- readln(log_data20.comment);
- end;
- writeln;
- write('Enter time category ("@" or "A" through "Z"): ');
- repeat
- read(kbd,ch);
- until upcase(ch) in ['@','A'..'Z'];
- writeln(upcase(ch));
- writeln;
- log_data31.usage := upcase(ch);
- seek(logfile31,filesize(logfile31));
- write(logfile31,log_data31);
- end; {for}
-
- Close(logfile31);
- Close(logfile20);
-
- End.